package com.cc.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author CC
 * @version 1.0
 * @description: 配置springdoc文档
 * @date 2025/9/18 8:33
 */
@Configuration
public class SpringDocConfig {

    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI()
                // 配置接口文档基本信息
                .info(this.getApiInfo())
                ;
    }

    private Info getApiInfo() {
        return new Info()
                .title("SpringBoot3集成Swagger3")
                .description("SpringBoot3集成Swagger3示例文档")
                .contact(new Contact().name("cc").url("https://www.52cc.cn").email("10000@qq.com"))
                .license(new License().name("Apache 2.0").url("https://www.xiezhrspace.cn"))
                .summary("SpringBoot3集成Swagger3示例文档")
                .termsOfService("https://www.52cc.cn")
                .version("1.0");
    }
}
